<template>
  <div class="contact-box">
    <div class="item"
         v-for="(item, index) in contactIcon" :key="index"
         @click="openTarget(item.targetUrl)">
      <i class="iconfont" :class="item.icon" :title="item.title"></i>
    </div>
  </div>
</template>

<script setup>
  import { contactIcon } from 'configs/localData.js'

  const openTarget = (url) => window.open(url);
</script>

<style lang="scss" scoped>
.contact-box {
  position: fixed;
  right: 28px;
  top: 28px;
  display: flex;
  flex-direction: column;
  .item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    &:hover {
      transform: scale(1.1);
    }
    i {
      color: #e65d5d;
    }
  }
}
</style>
